import type {App, Component} from "vue";
import SvgIcon from "../components/SvgIcon.vue"

const components: { [name: string]: Component } = { SvgIcon };
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import * as AntIconsVue from '@ant-design/icons-vue'

export default {
  install(app: App) {
    //安装全局组件
    Object.keys(components).forEach(key => {
      app.component(key, components[key]);
    });

    //导入icon图标
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component("el-" + key, component)
    }
    for (const [key, component] of Object.entries(AntIconsVue)) {
      app.component("ant-" + key, component)
    }

  }
}
